package com.glasses.manage.auth.dao.impl;

import com.glasses.manage.auth.dao.AccountDao;
import com.glasses.manage.auth.entity.Account;
import com.glasses.manage.core.dao.BaseDaoImpl;
import com.glasses.manage.core.entity.PageBean;
import com.glasses.manage.core.entity.PageParam;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @Auther: yuyang
 * @Date: 2019/7/1 17:39
 * @ClassName:BECTestDaoImpl
 * @Description: TODO
 */
@Repository("accountDao")
public class AccountDaoImpl extends BaseDaoImpl<Account> implements AccountDao {
    @Override
    public List<Account> getOne() {
        Map<String, Object> map = new HashMap<>();
        return super.listBy(map, "getOne");
    }


    @Override
    public PageBean<Account> getAll(PageParam pageParam) {
        Map<String, Object> map = new HashMap<>();
        return super.listPage(pageParam,map,"getAll");
    }

    @Override
    public List<Account> getNAll() {
        Map<String, Object> map = new HashMap<>();
        return super.listBy(map,"getNAll");
    }

    @Override
    public List<Account> getList() {
        Map<String, Object> map = new HashMap<>();
        return super.listBy(map,"getAll");
    }

    @Override
    public void update1(Account account) {
        super.update(account);
    }


    @Override
    public Long getCount() throws Exception{
        Map<String, Object> map = new HashMap<>();
        map.put("state",0);
        Long count=(Long)super.getBy(map,"getCount");
        return count;
    }
}
